package com.devshephard.rpcframework.acm.tree.util;

public class LC_2023 {

    public static void main(String[] args) {
        String[] nums = new String[]{"777","7","77","77"};
        String target = "7777";
        System.out.println(numOfPairs(nums, target));
    }


    public static int numOfPairs(String[] nums, String target) {

        //boolean[][] table = new boolean[nums.length][nums.length];
        int res = 0;

        String[] numsTemp = nums.clone();

        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < numsTemp.length; j++) {
                if(i == j) continue;
                if(target.equals(nums[i] + numsTemp[j])) res = res + 1;
            }
        }

        return res;
    }
}
